registerTests([
function Join_Test_Right_0()
{
	var myArray = [1,3,4,5];
	var myArray2 = [1,4,7];
	//Returns [ { left: 1, right: 1},
	//               { left: 4, right: 4},
	//               { left: null, right: 7}]
	var result = myArray.Join(myArray2, "(a, b) => a == b", linq.joinKind.right);

	Assert.areEqual(result.length, 3);
	Assert.isTrue(result[0].left == 1 && result[0].right == 1, "0: Expected {left: 1, right: 1} but got " + result[0]);
	Assert.isTrue(result[1].left == 4 && result[1].right == 4, "1: Expected {left: 4, right: 4} but got " + result[1]);
	Assert.isNotDefined(result[2].left, "2: Expected 'left' to be null but got " + result[2].left);
	Assert.areEqual(result[2].right, 7, "2: Expected 'right' to be 7 but got " + result[2].right);
},
function Join_Test_Left_0()
{
	var myArray = [{x: 1, y: "Hi"},{x:3, y:"There"},{x:4, y:"You"},{x:5, y:"!"}];
	var myArray2 = [{a:1, b:"chickens"},{a:4, b:"tigers"},{a:7, b:"sheep"}];
	var result = myArray.Join(myArray2, "(a, b) => a.x == b.a", linq.joinKind.left);

	Assert.areEqual(result.length, 4);
	Assert.isTrue(result[0].left.y == "Hi" && result[0].right.b == "chickens", "0: Result incorrect");
	Assert.isTrue(result[1].left.y == "There" && !result[1].right, "1: Result incorrect");
	Assert.isTrue(result[2].left.y == "You" && result[2].right.b == "tigers", "2: Result incorrect");
	Assert.isTrue(result[3].left.y == "!" && !result[3].right, "3: Result incorrect");
},
function Join_Test_Inner_0()
{
	var myArray = [{x: 1, y: "Hi"},{x:3, y:"There"},{x:4, y:"You"},{x:5, y:"!"}];
	var myArray2 = [{a:1, b:"chickens"},{a:4, b:"tigers"},{a:7, b:"sheep"}];
	var result = myArray.Join(myArray2, "(a, b) => a.x == b.a", linq.joinKind.inner);

	Assert.areEqual(result.length, 2);
	Assert.isTrue(result[0].left.y == "Hi" && result[0].right.b == "chickens", "0: Result incorrect");
	Assert.isTrue(result[1].left.y == "You" && result[1].right.b == "tigers", "1: Result incorrect");
},
]);